﻿<Window x:Class="UILibrary.ValidateApplicationCaptchaWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ValidateApplicationCaptcha" Height="200" Width="400">
    <Window.Resources>
        <Style TargetType="{x:Type TextBlock}" x:Key="HyperlinkText">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Cursor" Value="Hand" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30px"/>
            <RowDefinition Height="100px" />
            <RowDefinition Height="30px"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="100px" />
        </Grid.ColumnDefinitions>
        
        <!-- Row 0 -->
        <TextBlock Text="Please click here to accept the application" 
                   FontSize="20" TextDecorations="Underline"
                   Grid.ColumnSpan="2"
                   MouseUp="TextBlock_MouseUp" Foreground="Blue"
                   Style="{DynamicResource HyperlinkText}"/>
        
        <!-- Row 1 -->
        
        <StackPanel Orientation="Vertical"
                    Grid.Column="0" Grid.Row="1">
            <TextBlock Text="The application requires the code displayed on Twitter validation URL" 
                       TextWrapping="Wrap" FontSize="13"
                       Margin="5"/>
            <TextBlock Text="Click the link above to get this code!"
                       Margin="5" FontSize="13" FontStyle="Italic"/>
        </StackPanel>
        
        
        <Image Source="../Resources/TwitterOfficialIcon.png"
               Grid.Column="1" Grid.Row="1"
               Margin="5"/>
        
        <!-- Row 2 -->
        <TextBox x:Name="focus" Text="{Binding Captcha, Mode=TwoWay}"
                 FontSize="20"
                 Grid.Row="2" Grid.Column="0"
                 GotFocus="focus_GotFocus" LostFocus="focus_LostFocus"/>
        
        <Button Content="Validate" 
                Command="{Binding ValidateCommand}" 
                Grid.Column="1" Grid.Row="2"
                Margin="5, 0"/>
    </Grid>
</Window>